﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.Staff
{
    public partial class edit_banner : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = int.Parse(Session["admin_id"].ToString());
            string temp = Request.QueryString["img"];
            string img = temp.Split('\\')[temp.Split('\\').Length - 1];
            string temp2 = img;
            img = DateTime.Now.Day.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString();
            img += Session["admin_id"].ToString() + temp2;

            var get_admin = new TblManagerController().FetchAll().Where(x => x.ManagerId == id).Single();
            new TblManagerController().Update(id, get_admin.ManagerName, get_admin.ManagerPass, get_admin.Role, get_admin.FullName, get_admin.Birthday, get_admin.Sex, get_admin.Avatar, get_admin.Captain, get_admin.Phone, get_admin.Email, get_admin.Facebook, get_admin.Address, get_admin.Active, img, get_admin.Note);
        }
    }
}